﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace LearnDrive
{
    public partial class frmSum : Form
    {
        private float num;
        private frmStudy myf;
        private bool isclose = true;//是否直接关闭
        public frmSum(float i,frmStudy f)
        {
            InitializeComponent();
            num = i;
            myf = f;
        }

        private void frmSum_Load(object sender, EventArgs e)
        {
            this.TopMost = true;
            label1.Text = string.Format("学员：{0}",Myinfo.username);
            label2.Text = string.Format("成绩：{0}", num.ToString("F2"));
            if (num >= 100) button1.Visible = false;
            else button1.Visible = true;
            if(num>=90)
            label3.Text = "恭喜您！考试通过！";
            else
                label3.Text = "您没有通过考试，请继续努力吧！";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            myf.Close();
            isclose = false;
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            myf.onlyCuoTi();
            isclose = false;
            this.Close();
        }

        private void frmSum_FormClosing(object sender, FormClosingEventArgs e)
        {
            if(isclose)
            myf.Close();
        }
    }
}
